#include<iostream>
using namespace std;
int main()
{int n,m;
 cin>>n; 
 for(int i=1;i<=n;i++)
   {cin>>m;
    int sum=0;
    for(int j=1;j<=m;j++)
        sum+=j*(j+1)*(j+2)/2;
    cout<<i<<" "<<m<<" "<<sum<<endl;
    }
system("pause");
return 0;
}
